package com.starblink.library.widget.balloon

import android.content.Context
import androidx.lifecycle.LifecycleOwner
import com.skydoves.balloon.ArrowOrientation
import com.skydoves.balloon.ArrowPositionRules
import com.skydoves.balloon.Balloon
import com.skydoves.balloon.createBalloon
import com.starblink.library.widget.R

/**
 * 心愿单商品-更多-气泡弹窗工厂类
 */
class MoreSettingBalloonFactory : Balloon.Factory() {

    override fun create(context: Context, lifecycle: LifecycleOwner?): Balloon {

        return createBalloon(context) {
            setLayout(R.layout.layout_ballon_more_setting)
            setArrowOrientation(ArrowOrientation.TOP)
            setArrowPositionRules(ArrowPositionRules.ALIGN_ANCHOR)
            setArrowPosition(0.5f)
            setArrowWidth(20)
            setArrowHeight(10)
            setCornerRadius(16f)
            setMarginRight(12)
            setBackgroundColorResource(com.starblink.basic.style.R.color.white)
            setDimBehind(0.5f)
            setDismissWhenShowAgain(true)
            setLifecycleOwner(lifecycle)
            build()
        }
    }
}